<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>register</title>
		<meta name="author" content="Administrator" />
		<!-- Date: 2014-10-28 -->
		<link  rel="stylesheet"  type="text/css"  href="css/register.css">
		<script  src="js/jquery-1.11.1.min.js"  type="text/javascript"></script>
	</head>
	<body>
			
	<div class="all-wrap" id="container">

		<div class="PassportWrap">
<div class="passport_signup_case passport_case">
    <form class="signupform" action="/passport-create.html" method="post">
        <input type="hidden" value="" name="forward">
        <div class="intro">
            <div class="customMessages">
                <!--register_message-->
            </div>
        </div>
        <div class="loginbox">
            <ul>
                <li>
                <label class="login-k"><i>*</i>用户名：</label>
                <div class="login-v common_form_val"><input type="text" caution="请填写正确的用户名" maxlength="30" id="reg_user" data-full="true" vtype="required&amp;&amp;uname" name="pam_account[login_name]" class="x-input inputstyle" autocomplete="off"><span><span class="comment caution notice-inline">请输入6&mdash;20位字符，可使用字母和数字组合</span></span></div>
                </li>
                <li>
                <label class="login-k"><i>*</i>密码：</label>
                <div class="login-v common_form_val"><input type="password" onpaste="return false;" oncontextmenu="return false;" id="reg_passwd" caution="请填写正确的密码" data-full="true" vtype="required&amp;&amp;password" name="pam_account[login_password]" class="x-input inputstyle"><span><span class="comment caution notice-inline">请输入8至20个字母或数字组成的字符</span></span></div>
                </li>
                <li>
                <label class="login-k"><i>*</i>确认密码：</label>
                <div class="login-v common_form_val"><input type="password" onpaste="return false;" oncontextmenu="return false;" id="reg_passwd_r" data-full="true" vtype="confirm_password&amp;&amp;password" caution="" name="pam_account[psw_confirm]" class="x-input inputstyle"><span><span class="comment caution notice-inline">请再输入一次密码</span></span></div>
                </li>
                <li>
                <label class="login-k"><i>*</i>电子邮箱：</label>
                <div class="login-v common_form_val"><input type="text" placeholder="yourname@xx.com" caution="请填写正确的邮箱，例如：yourname@hotmail.com" id="reg_email" name="contact[email]" data-full="true" vtype="required" class="x-input " autocomplete="off"><span><span class="comment caution notice-inline">请输入你的常用邮箱</span></span></div>
                </li>
                                <li>
                <label class="login-k"><i>*</i>验证码：</label>
                <div class="login-v common_form_val passport_login_kocde"><input type="text" data-full="true" id="iptsingup" name="signupverifycode" maxlength="4" size="4" vtype="number&amp;&amp;required" class="x-input x-input" autocomplete="off"> <span style="display:none;" class="verifyCode"><img align="absmiddle" codesrc="/passport-verifyCode-s.html" src="#" id="vcode_img"><a href="javascript:void(0)" id="hdl_refresh_vcode">&nbsp;看不清楚?换个图片</a> </span></div>
                </li>
                                <li>
                <label class="login-k">&nbsp;</label>
                <div class="login-v"><input type="checkbox" autocomplete="off" id="license" name="license" value="agree" vtype="requried"> 我已阅读并同意 <a target="_blank" class="lnk" id="terms_error" href="http://sh.shequ001.com/article--36.html"><span id="terms_error_sym" class="FormText">会员注册协议</span></a>和<a target="_blank" class="lnk" id="privacy_error" href="http://sh.shequ001.com/article--35.html"><span id="privacy_error_sym" class="FormText">隐私保护政策</span></a>。</div>
                </li>
                <li>
                <label class="login-k">&nbsp;</label>
                <div class="login-v common_form_sub signup_sub">
                    <button data-ajax-config="{onComplete:function(rs){ if(rs[0]&amp;&amp;rs[0].error){ refreshVcode();}}}" value="立即注册" class="btn common-btn" rel="_request" type="submit"><span><span>立即注册</span></span></button>                    <input type="hidden" value="" name="forward">
                </div>
                </li>
            </ul>
         </div>
    </form>
    </div>
    
	<script>
		
		$('#reg_user').blur(function(){
			var input = this;
			if(input.value!=''){
				new Request({
					url:'/passport-namecheck.html',
					method:'post',
					data:input.name+'='+encodeURIComponent(input.value=input.value.trim()),
					onSuccess: function(rs) {
						rs = JSON.decode(rs);
						if(rs.error) {
							input.getNext().innerHTML = '<span class="error caution notice-inline">' +rs.error + '</span>';
						}
						else if(rs.success) {
							input.getNext().innerHTML = '<span class="success caution notice-inline">&nbsp;</span>';
						}
					}
				}).send();
			}
		});
		$('#reg_user').focus(function(){
			
			//$(this).innerHTML = '<span class="comment caution notice-inline">璇疯緭鍏�鈥�0浣嶅瓧绗︼紝鍙娇鐢ㄥ瓧姣嶅拰鏁板瓧缁勫悎</span>';
		});
		
		$('#reg_email').blur(function(){
			var input = this;
            if(input.value!=''){
                new Request({
                    url:'/passport-emailcheck.html',
                    method:'post',
                    data:input.name+'='+encodeURIComponent(input.value=input.value.trim()),
                    onSuccess: function(rs) {
                        rs = JSON.decode(rs);
                        if(rs.error) {
                            input.getNext().innerHTML = '<span class="error caution notice-inline">' +rs.error + '</span>';
                        }
                        else if(rs.success) {

                            input.getNext().innerHTML = '<span class="success caution notice-inline">&nbsp;</span>';

                        }

                    }
                }).send();
            }
			
		});
		
		$('#reg_email').focus(function(){
			
			//$(this).innerHTML = '<span class="comment caution notice-inline">请填写正确的邮箱，例如：yourname@hotmail.com</span>';
		});
		
		$('#reg_passwd,#reg_passwd_r').blur(function(){
			var content = $(this).val();
			if(content){
                    //检测长度
                    if(content.length<8 || content.length > 20){
                        //长度不符合
                        if($(this).attr("id")=='reg_passwd'){
                        	//alert($(this).next().html());
                            $(this).next().html('<span class="error caution notice-inline">请填写正确的密码</span>');
                        }else{
                            if($('#reg_passwd_r').val()!=$('#reg_passwd').val()){
                                $(this).next().html('<span class="error caution notice-inline">两次密码输入不一致</span>');
                            }
                        }
                    }else{
						
                        //长度符合 并且非空
                        if($('#reg_passwd_r').val()!=$('#reg_passwd').val()){

                            if($(this).attr("id")=='reg_passwd_r'){
                                $(this).next().html('<span class="error caution notice-inline">两次密码输入不一致</span>');
                            }
							
                            $(this).next().html('<span class="success caution notice-inline">&nbsp;</span>');
                        }else{

                            $(this).next().html('<span class="success caution notice-inline">&nbsp;</span>');
                            /*统一验证通过
                            reg_passwd.getNext().innerHTML = '<span class="success caution notice-inline">&nbsp;</span>';
                            reg_passwd_r.getNext().innerHTML = '<span class="success caution notice-inline">&nbsp;</span>'; */

                        }
                    }
                }
		});
	
		//$(".x-input").css("border","1px solid #972627");
		$('.x-input').focus(function(){
			$(this).css("border","1px solid #972627");
		});
		$('.x-input').blur(function(){
			$(this).css("border","1px solid #ddd");
		});
	</script>
</div>

	</div>
	</body>
</html>

